package com.bbva.gptf.back.transformador;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

import com.bbva.gptf.back.dominio.Tgpt031OrdenDeuda;
import com.bbva.gptf.dto.bean.Orden;

public class TransformadorFolioOrden implements
		Converter<Tgpt031OrdenDeuda, Orden> {

	@Autowired
	private TransformadorGestor transformadorGestor;

	@Override
	public Orden convert(Tgpt031OrdenDeuda source) {
		Orden orden = new Orden();
		orden.setCdOrden(source.getCdOrdenDeuda());
		orden.setFhOperacion(source.getFhOperacion());
		orden.setStOrden(source.getStOrden());
		orden.setTpOperacion(source.getTpOperacion());
		if (source.getCdGestor() != null) {
			orden.setGestor(transformadorGestor.convert(source.getCdGestor()));
		}
		return orden;
	}

	public void setTransformadorGestor(TransformadorGestor transformadorGestor) {
		this.transformadorGestor = transformadorGestor;
	}

}
